import request from '@/utils/requestMd5'

export function role_index(params) {
  return request({
    // url: '/role/index',
    url: '/global/roleIndex',
    method: 'get',
    params
  })
}

export function role_add(data) {
  return request({
    // url: '/role/add',
    url: '/global/addRole',
    method: 'post',
    data:data
  })
}

export function role_edit(data) {
  return request({
    // url: '/role/edit',
    url: '/global/editRole',
    method: 'post',
    data:data
  })
}

export function role_delete(data) {
  return request({
    // url: '/role/delete',
    url: '/global/deleteRole',
    method: 'post',
    data:data
  })
}

//授权菜单列表
export function role_auth(params) {
  return request({
    // url: '/role/auth',
    url: '/global/authRole',
    method: 'get',
    params
  })
}

//授权
export function role_accredit(data) {
  return request({
    // url: '/role/accredit',
    url: '/global/accreditRole',
    method: 'post',
    data:data
  })
}

//客户角色接口
export function custrole_index(data) {
  return request({
    url: '/product/getCustRoleList',
    method: 'get',
    data:data
  })
}

export function custrole_edit(data) {
  return request({
    url: '/product/editCustRole',
    method: 'post',
    data:data
  })
}

export function custrole_add(data) {
  return request({
    url: '/product/addCustRole',
    method: 'post',
    data:data
  })
}